home *** CD-ROM | disk | FTP | other *** search
- (*----------------------------------------------------------------------*)
- (* Min --- Find minimum of two integers *)
- (*----------------------------------------------------------------------*)
-
- Function Min( A, B: Integer ) : Integer;
-
- (*----------------------------------------------------------------------*)
- (* *)
- (* Function: Min *)
- (* *)
- (* Purpose: Returns smaller of two numbers *)
- (* *)
- (* Calling sequence: *)
- (* *)
- (* Smaller := MIN( A , B ) : Integer; *)
- (* *)
- (* A --- 1st input integer number *)
- (* B --- 2nd input integer number *)
- (* Smaller --- smaller of A, B returned *)
- (* *)
- (* *)
- (* Calls: None *)
- (* *)
- (* *)
- (*----------------------------------------------------------------------*)
-
- Begin (* Min *)
-
- IF A < B Then
- Min := A
- Else
- Min := B;
-
- End (* Min *);
-
- (*----------------------------------------------------------------------*)
- (* Max --- Find maximum of two integers *)
- (*----------------------------------------------------------------------*)
-
- Function Max( A, B: Integer ) : Integer;
-
- (*----------------------------------------------------------------------*)
- (* *)
- (* Function: Max *)
- (* *)
- (* Purpose: Returns larger of two numbers *)
- (* *)
- (* Calling sequence: *)
- (* *)
- (* Larger := MAX( A , B ) : Integer; *)
- (* *)
- (* A --- 1st input integer number *)
- (* B --- 2nd input integer number *)
- (* Larger --- Larger of A, B returned *)
- (* *)
- (* *)
- (* Calls: None *)
- (* *)
- (*----------------------------------------------------------------------*)
-
- Begin (* Max *)
-
- IF A > B Then
- Max := A
- Else
- Max := B;
-
- End (* Max *);